package com.eapi.project.utils;

import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.json.JSONUtil;
import com.eapi.project.model.dto.user.AliPayRequest;


/**
 *  调用第三方接口的客户端
 */
public class AliPayApiUtils {
    public static String AliPay(AliPayRequest aliPayRequest){
        String jsonStr = JSONUtil.toJsonStr(aliPayRequest);
        HttpResponse response = HttpRequest.post("https://alipay-function-gxiixmofqw.cn-hangzhou.fcapp.run/$path")
                .contentType("text/plain") // 设置请求体的内容类型
                .body(jsonStr) // 设置请求体为字符串
                .execute();
        return response.body();
    }
}
